import { PartialType } from '@nestjs/mapped-types';
import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsNumber, IsOptional } from 'class-validator';
import { CreateUserDto } from './create-user.dto';

export class UpdateUserDto extends PartialType(CreateUserDto) {
  @ApiProperty({ example: 1, description: '用户id', required: false })
  @IsNumber()
  @IsOptional()
  id?: number;

  @ApiProperty({
    example: ['user'],
    description: '角色暂定(user、admin)',
    required: false,
  })
  @IsArray()
  @IsOptional()
  roles?: string[];
}
